﻿using System;
using System.Collections.Generic;
using System.Composition;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System.Events
{
    public interface IMessageRecipient
    {
        void ProcessMessage(object message);
    }

    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class MessageRecipientExportAttribute : ExportAttribute
    {
        public string Name { get; set; }
        public Type MessageType { get; set; }
        public bool Force { get; set; }

        public MessageRecipientExportAttribute()
        {
        }

        public MessageRecipientExportAttribute(string Name, Type MessageType, bool Force = true)
            : base(typeof(IMessageRecipient))
        {
            this.Name = Name;
            this.MessageType = MessageType;
            this.Force = Force;
        }
    }
}
